//
//  RocRemoteControlVC.m
//  RocRemoteControlProject
//
//  Created by 李照鹏 on 2018/12/14.
//  Copyright © 2018年 Roc. All rights reserved.
//

#import "RocRemoteControlVC.h"
#import "RocRemoteControlView.h"

@interface RocRemoteControlVC () <RocRemoteControlViewDelegate>

@end

@implementation RocRemoteControlVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self basicSet];
    [self buildMianUI];
}
//支持旋转
-(BOOL)shouldAutorotate{
    return YES;
}
//支持的方向
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscapeRight;
}
//一开始的方向  很重要
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
    return UIInterfaceOrientationLandscapeRight;
}

#pragma mark - 基础设置
- (void)basicSet
{
    self.title = @"遥控模式";
    self.view.backgroundColor = [UIColor whiteColor];
}

#pragma mark - 搭建界面
- (void)buildMianUI
{
    CGFloat x = 0;//LK_IS_IPHONE_X ? LK_STATUS_BAR_HEIGHT:0;
    RocRemoteControlView *view = [[RocRemoteControlView alloc] initWithFrame:CGRectMake(x, 0, LK_SCREEN_MAX_LENGTH-x, LK_SCREEN_MIN_LENGTH)];
    view.mydelegate = self;
    [self.view addSubview:view];
}
#pragma mark - delegate
#pragma mark -- RocRemoteControlViewDelegate
- (void)RocRemoteControlView:(RocRemoteControlView *)view ClickButton:(RocRemoteControlViewButtonType)type
{
    switch (type) {
        case RocRemoteControlViewButtonSwitch:
        {
            [[RocAPPManager Manager] SwitchToProgrammingMode];
        }
            break;
            
        default:
            break;
    }
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
